package com.aliyun.oss.mapper;

import com.aliyun.oss.pojo.Entity.Food;
import com.aliyun.oss.pojo.Vo.FoodVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface FoodMapper extends BaseMapper<Food> {
    @Select("SELECT d.id, d.name,d.image,d.price,d.status,c.name category_name,d.update_time FROM dish d LEFT JOIN category c on d.category_id =c.id")
    List<FoodVO> getAllFoods();

    List<FoodVO> queryFoodLikeByNameOrCategoryIdOrStatus(@Param("name") String name,@Param("categoryId") Integer categoryId,@Param("status") Integer status);
}
